#ifndef _IMAGE_H_
#define _IMAGE_H_

#include "Texture.h"
#include "Rectangle.h"
#include "SmartPtr.h"

class CImage;
 
typedef CSmartPtr<CImage> TImagePtr;
class CImage
{
public:
	
	void BlitImage(int iXOffset=0, int iYOffset=0) const;

	void BlitImagePart(int iXOffset, int iYOffset, const TRectanglei& part);

	
	CTexture* GetTexture() const  { return m_pTexture; }

	static TImagePtr CreateImage(const std::string& strFileName);
	static TImagePtr CreateImage(const std::string& strFileName, 
								 const TRectanglei& textCoord);

	~CImage();

protected:
	CImage(const std::string& strFileName);
	CImage(const std::string& strFileName, const TRectanglei& textCoord);

private:
	
	CTexture*   m_pTexture;
	
	TRectanglei  m_rectTextCoord;
};

#endif  